//
//  LotteryModel.m
//  MoXiProject
//
//  Created by 周筱雯 on 2017/7/17.
//  Copyright © 2017年 周筱雯. All rights reserved.
//

#import "LotteryModel.h"

@implementation LotteryModel

+(NSDictionary *)JSONKeyPathsByPropertyKey
{
    return nil;
}
@end


@implementation LotteryListModel
    
+(NSDictionary *)JSONKeyPathsByPropertyKey
{
        /**自定义         网络**/
        return @{@"listissueno"      : @"issueno",
                 @"listnumber"       : @"number",
                 @"listopendate"     : @"opendate",
                 @"listrefernumber"  : @"refernumber",
                 @"listtotalmoney"   : @"totalmoney",
                 @"listsaleamount"   : @"saleamount",
                 @"prizeArray"       : @"prize"
                 };
}

+ (NSValueTransformer *)JSONTransformerForKey:(NSString *)key
{
    return [MTLValueTransformer reversibleTransformerWithBlock:^id(id value) {
        return DEF_OBJECT_TO_STIRNG(value);
    }];
}

+ (NSValueTransformer *)prizeArrayJSONTransformer
{
    return [MTLValueTransformer reversibleTransformerWithBlock:^id(NSMutableArray *prize) {
        return [MTLJSONAdapter modelsOfClass:[LotteryPrizeModel class] fromJSONArray:prize error:nil];
    }];
}

@end
